<?php 
session_start();
 
include_once("../c/config.php");
$mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
if (!$mysqli->set_charset("utf8")) {printf("Error loading character set utf8: %s\n", $mysqliTwo->error);}

$qu='通州区';
if (isset($_GET['qu'])){
    $qu=$_GET['qu'];
}

$sql="SELECT school FROM `u3` WHERE `fxqu` LIKE '".$qu."' GROUP by school";
$query=$mysqli->query($sql);
    
$school=array();
while ($list=$query->fetch_assoc()){
    $school[]=$list['school'];
}
echo implode(', ',$school);
echo "<br /><br /><br />";
foreach ($school as $v){
    $sql="SELECT COUNT(id) as count FROM `u3` WHERE `school` LIKE '".$v."' ORDER BY `szqu` DESC";
    $query=$mysqli->query($sql);
    $getData=$query->fetch_assoc();
    echo $v,': ',$getData['count'];
    echo "<br />";
}


$mysqli->close();
	
 